#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n,x,y,z;
	cin >> n >> x >> y >> z;
	if((z>=x&&z<=y)||(z<=x&&z>=y))
	{
		cout << "Yes" << endl;
	}
	else
	{
		cout << "No" << endl;
	}
	return 0;
}
